package Homework_Test;

/**
 * @author caesar
 * @date 2025/7/11
 * @Description:
 * @apiNote
 */
public class Test3 {
    public static void main(String[] args){
        Son1 s1 = new Son1();
        System.out.println("a = " + s1.getA());
    }
}
class Father1{
    private int a = getNumber();
    {
        System.out.println("Father非静态代码块 a = " + a);
    }
    Father1(){
        System.out.println("Father()无参构造");
    }
    public int getNumber(){
        System.out.println("Father:getNumber()");
        return 1;
    }
    public int getA() {
        return a;
    }
}
class Son1 extends Father1{
    {
        System.out.println("Son非静态代码");
    }
    public Son1(){
        System.out.println("Son()：无参构造");
    }
    public int getNumber(){
        System.out.println("Son:getNumber()");
        return 2;
    }
}